/**
 * @author Fang Lu, fanglupku@gmail.com
 * 2011-5-16
 */
package com.autotag.entity;

import java.io.Serializable;
import java.util.HashMap;

public class NPEntity implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String content;
	private HashMap<Integer, Integer> levelMapCount;
	private int tokenNum;
	public static int getTokenNum(String inputStr, String delim){
		int result = 0;
		if (delim == null){
			delim = " ";
		}
		if (inputStr != null){
			String [] tA = inputStr.split(delim);
			for (int i=0; i<tA.length; ++i){
				if (tA[i].trim().length() > 0){
					++ result;
				}
			}
		}
		return result;
	}
	public NPEntity(){
		
	}
	public NPEntity(String content,
			HashMap<Integer, Integer> levelMapCount){
		this.content = content;
		this.levelMapCount = levelMapCount;
		this.tokenNum = getTokenNum(this.content, " ");
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public HashMap<Integer, Integer> getLevelMapCount() {
		return levelMapCount;
	}
	public void setLevelMapCount(HashMap<Integer, Integer> levelMapCount) {
		this.levelMapCount = levelMapCount;
	}
	public int getTokenNum() {
		return tokenNum;
	}
	public void setTokenNum(int tokenNum) {
		this.tokenNum = tokenNum;
	}
	
}
